package com.ziytek.web.citizen.mapper;

import com.ziytek.web.citizen.configuration.db.DDS;
import com.ziytek.web.citizen.constant.DdsConstant;
import com.ziytek.web.citizen.pojo.basic.SettingDetail;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author fenghx
 * @version 1.0
 * @className SettingDetailMapper
 * Description:
 * @date 2024/3/25 16:08
 */
@Mapper
public interface SettingDetailMapper extends EasyBaseMapper<SettingDetail> {


    /**
     * Description: 查询id
     *
     * @return Long
     */
    @DDS(DdsConstant.DS_BASIC)
    Long queryMaxId();

    /**
     * Description: 新增
     *
     * @param basic basic
     */
    @DDS(DdsConstant.DS_BASIC)
    void insertData(SettingDetail basic);

    /**
     * Description: 删除
     *
     * @param stepId     工步方案ID
     * @param updateTime 删除时间
     */
    @DDS(DdsConstant.DS_BASIC)
    void deleteByStepId(Long stepId, long updateTime);

    /**
     * Description: 删除
     *
     * @param interruptOrEndStepId 关联工步方案ID
     * @param updateTime           删除时间
     */
    @DDS(DdsConstant.DS_BASIC)
    void deleteByInterruptOrEndStepId(Long interruptOrEndStepId, long updateTime);

    /**
     * Description: 查询列表数据
     *
     * @param stepId 工步方案ID
     * @return List<SettingDetailTable>
     */
    @DDS(DdsConstant.DS_BASIC)
    SettingDetail queryListByStepIdDesc(Long stepId);

    /**
     * Description: 查询工步执行方案
     *
     * @param stepId       工步方案ID
     * @param settingOrder settingOrder
     * @return SettingDetailTable
     */
    @DDS(DdsConstant.DS_BASIC)
    SettingDetail queryListByStepIdAndSettingOrder(Long stepId, int settingOrder);

    /**
     * Description: 查询工步执行方案
     *
     * @param stepId       工步方案ID
     * @return SettingDetailTable
     */
    @DDS(DdsConstant.DS_BASIC)
    SettingDetail queryChargeSetting(Long stepId);

    /**
     * Description: 查询工步执行方案
     *
     * @param stepId 工步方案ID
     * @param settingOrder 执行顺序
     * @return SettingDetailTable
     */
    @DDS(DdsConstant.DS_BASIC)
    int queryTimeCountByStepId(Long stepId, Integer settingOrder);
}
